<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<%
	//컨트롤러에서 MemberCommand 로 선언하였으므로 아래도 MemberCommand 로 받음.
%>
<spring:hasBindErrors name="command"/>

<script type="text/javascript">
function chkLogin(form){
	var id = form.id;
	var ps = form.pass;

	if(!id.value){alert('아이디를 입력한 후 눌러주세요.');id.focus();return;}
	else if (!ps.value) {alert('비밀번호를 입력한 후 눌러주세요.');ps.focus();return;}
	
	form.action="/user/Login.do";
	form.submit();
}

function moveJoin(){
	location.href='/user/MemberJoin.do';
	
}

function moveSearch(){
	alert('아이디, 비밀번호 찾기 이동');
	location.href='/user/UserDataSearch.do';
}
</script>

<a style="font-size: 20px; font-weight: bold;">Dearland</a> Login
<hr class="1">
<div style="float: left; width:360px">
	
	<form method="post">
	<div style="width : 220px;float: left; padding: 15px 5px 5px 5px;">
	<ul class="Login">
		<li>
			<label class="Login">아이디 입력</label>
			<input type="text" name="id" id="id" autofocus="autofocus" value="${command.id}"
			 onclick="idnull()" maxlength="12" style="width: 100px;">
		</li>
		<li>
			<label class="Login">비밀번호 입력</label>
			<input type="text" name="pass" id="pass" value="${command.nick}" onclick="nickchknull()" maxlength="12" style="width: 100px;">
		</li>
	</ul>
	</div>
	<div style="width : 120px;float: left; padding: 15px 4px 4px 5px;">
		<input type="button" onclick="chkLogin(this.form)" value="로그인" style="height: 50px; width: 120px; padding-top : 5px;">
	</div>
	</form>
	<div style="clear: both; width:345px; border:0px solid; margin-left: 6px;">
	
	Error Massage.
	<div style="clear: both; width:100%; border:1px solid; height: 30px ">
		<form:errors path="command.id" element="div"/>
		<form:errors path="command.pass" element="div"/>
		<form:errors path="command" element="div"/>
	</div>
	
	</div>
	
	
	<div style="width : 340px;float: left;; padding: 15px 4px 2px 5px;">
	회원정보가 기억나지 않는다면??<br>
	<input type="button" value="아이디, 비밀번호 찾기" style="height: 32px; width: 350px; margin-top : 10px; padding-top : 5px;" onclick="moveSearch();">
	</div>
	
	<div style="width : 340px;float: left;; padding: 15px 4px 4px 5px;">
	회원이 아닌 것 같아요!!!<br>
	<input type="button" value="회원 가입하기" style="height: 32px; width: 350px; margin-top : 10px; padding-top : 5px;" onclick="moveJoin()">
	</div>
		

</div>
<div style="float: right;">
	<img alt="아이디가 기억나지 않는다면 아이디,비밀번호 찾기를 실행해주세요." src="../img/login.png" align="top" border="0">
</div>

<hr class="2" style="clear: both;">